﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="js/CallManager.js"></script>
</head>

<body>
    <div class="container">
        <div class="top">
            <div class="logo"></div>
            <div class="name">医生周排班</div>
            <div class="date" id="divDate"></div>
            <div class="space"></div>
            <div class="time" id="divTime"></div>
        </div>
        <div class="main">
            <div class="main-container">
                <div class="main-left">
                    <div class="main-left1" id="divPagerName1">收费1</div>
                    <div class="main-left2" id="divPatientName1"><span class="main-red">暂停服务</span></div>
                </div>
                <div class="main-blank"></div>
                <div class="main-left">
                    <div class="main-left1" id="divPagerName2">收费2</div>
                    <div class="main-left2" id="divPatientName2"><span class="main-red">暂停服务</span></div>
                </div>
            </div>
        </div>
        <div class="bottom"></div>
    </div>
</body>
</html>
<script type="text/javascript">

    function ShowTime() {
        try {
            var datetime = window.Callobject.getDateTime();
            var year = datetime.split(' ')[0].split('-')[0].toString() + '年' + datetime.split(' ')[0].split('-')[1].toString() + '月' + datetime.split(' ')[0].split('-')[2].toString() + '日';
            var week = "　星期" + "日一二三四五六".charAt(datetime.split(' ')[2].toString().trim().replace('7', '0'));
            var time = datetime.split(' ')[1].toString();
            document.getElementById("divDate").innerHTML = year + week;
            document.getElementById("divTime").innerHTML = time.split(':')[0] + ':' + time.split(':')[1];

        }
        catch (ex) { }
    }
    ShowTime();

    var pa1 = "";
    var pa2 = "";
    var p_c1 = 0;
    var p_c2 = 0;
    var c_1 = 0;
    var c_2 = 0;
    function PagerCall() {
        $.ajax({
            type: "POST",
            url: "http://192.168.0.235:81/triage/call_patient/CallPatient",
            contentType: "application/text;charset=utf-8",
            dataType: "json",
            success: function (data) {
                if (data.count != "0") {
                    $.each(data.list, function (i, item) {

                        $("#divPatientName1").html('<span class="main-red">' + item.patient_name + '</span>');
                                $("#divPatientName1").fadeOut("500").fadeIn("500").fadeOut("500").fadeIn("500").fadeOut("500").fadeIn("500");
                                var callText = "<?xml version=\"1.0\" encoding=\"GB18030\"?>"
                                    + "<Contents><Content>"
                                    + "<Voice Num=\"1\" Speed=\"700\" digitMode=\"2\">"
                                    + "请 " + item.patient_name + "到1窗口办理。"
                                    + "</Voice>"
                                    + "</Content></Contents>";
                                window.Callobject.playVoice(callText);
                               

                    });
                }
            }
        });
    }
    //PagerCall();
    window.setInterval(PagerCall, 10000);
</script>